package main

import (
	"os"
	"strconv"

	"github.com/therecipe/qt/widgets"
)

var count int64

// qtdeploy -fast test desktop buttView
// qtdeploy test desktop buttView
func main() {
	app := widgets.NewQApplication(len(os.Args), os.Args)

	window := widgets.NewQMainWindow(nil, 0)
	window.SetMinimumSize2(640, 480)
	window.SetWindowTitle("shuoGG")

	widget := widgets.NewQWidget(nil, 0)
	widget.SetLayout(widgets.NewQVBoxLayout())
	window.SetCentralWidget(widget)

	textEdit := widgets.NewQTextEdit(nil)
	widget.Layout().AddWidget(textEdit)

	button := widgets.NewQPushButton2("Ok", nil)
	button.ConnectClicked(func(bool) {
		textEdit.InsertPlainText(strconv.FormatInt(count, 10))
		count++
	})
	widget.Layout().AddWidget(button)

	window.Show()
	app.Exec()
}
